package cn.com.b2office.util;

import java.util.Random;

/**
 * @author  zhenggang
 * @version Jul 16, 2008 4:27:34 PM
 * comment
 */
public class RandomString {
	
	public static String getRandomString(int length) { 
		
	    StringBuffer buffer = new StringBuffer("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); 
	    StringBuffer sb = new StringBuffer(); 
	    Random random = new Random(); 
	    int range = buffer.length(); 
  
	    for (int i = 0; i < length; i ++) { 
	        sb.append(buffer.charAt(random.nextInt(range))); 
	    } 
	    return sb.toString(); 
	}
}
